package com.dingpeikeji.quickdeer.modules.applycargo.service;

import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.dingpeikeji.quickdeer.core.common.persistence.Page;
import com.dingpeikeji.quickdeer.core.common.service.CrudService;
import com.dingpeikeji.quickdeer.modules.applycargo.dao.TApplycargoDao;
import com.dingpeikeji.quickdeer.modules.applycargo.entity.TApplycargo;

/**
 * 客运公司车辆加盟Service
 * @author dp
 * @version 2017-01-04
 */
@Service
@Transactional(readOnly = true)
public class TApplycargoService extends CrudService<TApplycargoDao, TApplycargo> {

	public TApplycargo get(String acid) {
		return super.get(acid);
	}
	
	public List<TApplycargo> findList(TApplycargo tApplycargo) {
		return super.findList(tApplycargo);
	}
	
	public Page<TApplycargo> findPage(Page<TApplycargo> page, TApplycargo tApplycargo) {
		return super.findPage(page, tApplycargo);
	}
	
	@Transactional(readOnly = false)
	public void save(TApplycargo tApplycargo) {
		if(tApplycargo.getAcid() == null) {
			tApplycargo.setCreateDate(new Date());
			tApplycargo.setUpdateDate(new Date());
			dao.insert(tApplycargo);
		} else {
			tApplycargo.setUpdateDate(new Date());
			dao.update(tApplycargo);
		}
	}
	
	@Transactional(readOnly = false)
	public void delete(TApplycargo tApplycargo) {
		super.delete(tApplycargo);
	}
	
}